//
//  HSPFirstCell.m
//  Icar
//
//  Created by dllo on 15/10/16.
//  Copyright © 2015年 小龙侠. All rights reserved.
//

#import "HSPFirstCell.h"
#import "BaseHeader.h"
@implementation HSPFirstCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creat];
    }
    return self;
}
- (void)creat
{
    self.iamgeLeft = [[UIImageView alloc]initWithFrame:CGRectMake(10 * ADJUSTWIDTH, ADJUSTHEIGHT * 5, ADJUSTWIDTH * 120, ADJUSTHEIGHT * 75)];
    [self.contentView addSubview:self.iamgeLeft];
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(ADJUSTWIDTH * 135, 0, ADJUSTWIDTH * 240, ADJUSTHEIGHT * 50)];
    self.titleLabel.font =[UIFont systemFontOfSize:17. * ADJUSTWIDTH];
    self.titleLabel.numberOfLines = 0;
    [self.contentView addSubview:self.titleLabel];
    
    self.putLabel = [[UILabel alloc]initWithFrame:CGRectMake(ADJUSTWIDTH * 135, ADJUSTHEIGHT * 60, ADJUSTWIDTH * 80, ADJUSTHEIGHT * 25)];
    self.putLabel.font =[UIFont systemFontOfSize:14. * ADJUSTWIDTH];
    self.putLabel.textColor = [UIColor grayColor];
    self.putLabel.numberOfLines = 0;
    [self.contentView addSubview:self.putLabel];
    
    self.countLabel = [[UILabel alloc]initWithFrame:CGRectMake(ADJUSTWIDTH * 315, ADJUSTHEIGHT * 60, ADJUSTHEIGHT * 80, ADJUSTHEIGHT * 30)];
    self.countLabel.font =[UIFont systemFontOfSize:14.* ADJUSTWIDTH];
    self.countLabel.textColor = [UIColor grayColor];
    self.countLabel.numberOfLines = 0;
    [self.contentView addSubview:self.countLabel];
    
    
}
- (void)getImage:(HSPLatestModel *)model
{
   
    [self.iamgeLeft sd_setImageWithURL:[NSURL URLWithString:model.image]placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    if (model.count.intValue == 0) {
        self.countLabel.text = @"抢沙发";
    }
    else
    {
        self.countLabel.text = [NSString stringWithFormat:@"%@评论",model.count];
        
    }
    self.putLabel.text = model.pubDate;
    self.titleLabel.text = model.title;
}
- (void)getCarImage:(HSPNewCarModel *)modelCar
{
    [self.iamgeLeft sd_setImageWithURL:[NSURL URLWithString:modelCar.image]placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    if (modelCar.count.intValue == 0) {
        self.countLabel.text = @"抢沙发";
    }
    else
    {
        self.countLabel.text = [NSString stringWithFormat:@"%@评论",modelCar.count];
        
    }
    self.putLabel.text = modelCar.pubDate;
   self.titleLabel.text = modelCar.title;
}
- (void)getlistImage:(HSPImageAppreciate *)modelList
{
    [self.iamgeLeft sd_setImageWithURL:[NSURL URLWithString:modelList.url]placeholderImage:[UIImage imageNamed:@"1.jpg"]];
}
- (void)getShopImage:(HSPShopperModel *)modelShop
{
    [self.iamgeLeft sd_setImageWithURL:[NSURL URLWithString:modelShop.image]placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    if (modelShop.count.intValue == 0) {
        self.countLabel.text = @"抢沙发";
    }
    else
    {
        self.countLabel.text = [NSString stringWithFormat:@"%@评论",modelShop.count];
        
    }
    self.putLabel.text = modelShop.pubDate;
    self.titleLabel.text = modelShop.title;
}
- (void)getVideo:(HSPVideoModel *)modelVideo
{
    [self.iamgeLeft sd_setImageWithURL:[NSURL URLWithString:modelVideo.image]placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    if (modelVideo.count.intValue == 0) {
        self.countLabel.text = @"抢沙发";
    }
    else
    {
        self.countLabel.text = [NSString stringWithFormat:@"%@评论",modelVideo.count];
        
    }
    self.putLabel.text = modelVideo.pubDate;
    self.titleLabel.text = modelVideo.title;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
